package com.chu.test;

import java.util.concurrent.atomic.AtomicLongFieldUpdater;

public class MyInteger {


    public volatile long lock;


    AtomicLongFieldUpdater<MyInteger> lock2 = AtomicLongFieldUpdater.newUpdater (MyInteger.class,"lock");


    private void acquireLock(){
        long id = Thread.currentThread().getId();
        while (lock2.compareAndSet(this, 0L,id)){
                           ///
        }

    }
}
